package com.treasure.mall.zbqmallapi.websocket;

import lombok.extern.slf4j.Slf4j;

import javax.websocket.HandshakeResponse;
import javax.websocket.server.HandshakeRequest;
import javax.websocket.server.ServerEndpointConfig;

/**
 * 
 * <p>
 * +---------------------------------------------------------
 * * @package: com.treasure.mall.zbqmallapi.websocket
 * * @author: guomw (guomwchen@foxmail.com)
 * * @date: 2020/9/18 10:29 上午
 * * @since: V1.0.0
 * +---------------------------------------------------------
 * 注意：本内容仅限于内部传阅，禁止外泄以及用于其他的商业目的
 * 
 */
@Slf4j
public class WebSocketConfigurator extends ServerEndpointConfig.Configurator {
    @Override
    public void modifyHandshake(ServerEndpointConfig sec, HandshakeRequest request, HandshakeResponse response) {
        sec.getUserProperties().put("headers", request.getHeaders());
    }
}
